import React from 'react'
import ReactDOM from 'react-dom'

// .children相当于引用组件时子节点

const Header = (props) => {
    return <header>
        { props.children }
    </header>
}

class Content extends React.Component {
    render () {
        return <section>
            { this.props.children }
        </section>
    }
}
const App = () => {
    return (
        <div>
            <Header>欢迎来到<i>react</i>都世界</Header>
            <Content><i>react.js</i>核心库只关注于视图层</Content>
        </div>
    )
}

ReactDOM.render(
    <App />,
    document.getElementById('root')
)